<template>
  <div class="playlist__item">
    <div class="playlist__item__cover">
      <img :src="cover" :alt="{ title }" />
    </div>
    <div class="playlist__item__title">{{ title }}</div>
  </div>
</template>
<script>
import { defineComponent } from 'vue'
import logo from '@assets/logo.png'

export default defineComponent({
  name: 'PlayList',
  props: {
    title: {
      type: String,
      default: '歌单名称',
      required: true
    },
    cover: {
      type: String,
      default: logo,
      required: true
    }
  }
})
</script>

<style lang="less" scoped>
.playlist__item {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 105px;
  overflow: hidden;

  .playlist__item__cover {
    width: 100px;
    background-color: #f7f8fa;
    border-radius: 20px;
    overflow: hidden;

    img {
      width: 100%;
    }
  }

  .playlist__item__title {
    width: 100%;
    margin-top: 6px;
    font-size: 14px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}
</style>
